import 'package:flutter/material.dart';

import 'share_data_widget.dart';
import 'show_data.dart';

class LYHomeInteritedPage extends StatefulWidget {
  @override
  _LYHomeInteritedPageState createState() => _LYHomeInteritedPageState();
}

class _LYHomeInteritedPageState extends State<LYHomeInteritedPage> {
  int data = 100;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("InheritedWidget"),
      ),
      body: HYDataWidget(
        counter: data,
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[TestShareDataWidget()],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {
          setState(() {
            data++;
          });
        },
      ),
    );
  }
}
